package vip.ifmm.lehouse.common.model;

import lombok.Builder;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

@Document(indexName = "lehouse-enclosure", type = "enclosure")
@Builder
@ToString
public class Enclosure implements Serializable {

    private static final long serialVersionUID = 9527880l;

    @Id
    private Integer enclosureId;

    @Field(type = FieldType.Keyword)
    private String enclosureName;

    @Field(type = FieldType.Integer)
    private Integer enclosureSize;

    @Field(type = FieldType.Keyword)
    private String enclosureSuffix;

    @Field(type = FieldType.Text)
    private String enclosurePath;

    @Field(type = FieldType.Date)
    private Date enclosureCreateTime;

    @Field(type = FieldType.Date)
    private Date enclosureUpdateTime;

    public Integer getEnclosureId() {
        return enclosureId;
    }

    public void setEnclosureId(Integer enclosureId) {
        this.enclosureId = enclosureId;
    }

    public String getEnclosureName() {
        return enclosureName;
    }

    public void setEnclosureName(String enclosureName) {
        this.enclosureName = enclosureName == null ? null : enclosureName.trim();
    }

    public Integer getEnclosureSize() {
        return enclosureSize;
    }

    public void setEnclosureSize(Integer enclosureSize) {
        this.enclosureSize = enclosureSize;
    }

    public String getEnclosureSuffix() {
        return enclosureSuffix;
    }

    public void setEnclosureSuffix(String enclosureSuffix) {
        this.enclosureSuffix = enclosureSuffix == null ? null : enclosureSuffix.trim();
    }

    public String getEnclosurePath() {
        return enclosurePath;
    }

    public void setEnclosurePath(String enclosurePath) {
        this.enclosurePath = enclosurePath == null ? null : enclosurePath.trim();
    }

    public Date getEnclosureCreateTime() {
        return enclosureCreateTime;
    }

    public void setEnclosureCreateTime(Date enclosureCreateTime) {
        this.enclosureCreateTime = enclosureCreateTime;
    }

    public Date getEnclosureUpdateTime() {
        return enclosureUpdateTime;
    }

    public void setEnclosureUpdateTime(Date enclosureUpdateTime) {
        this.enclosureUpdateTime = enclosureUpdateTime;
    }

    public Enclosure() {
    }

    public Enclosure(Integer enclosureId, String enclosureName, Integer enclosureSize, String enclosureSuffix, String enclosurePath, Date enclosureCreateTime, Date enclosureUpdateTime) {
        this.enclosureId = enclosureId;
        this.enclosureName = enclosureName;
        this.enclosureSize = enclosureSize;
        this.enclosureSuffix = enclosureSuffix;
        this.enclosurePath = enclosurePath;
        this.enclosureCreateTime = enclosureCreateTime;
        this.enclosureUpdateTime = enclosureUpdateTime;
    }
}